<include file="Public/header"/>

<div class="x-nav">
      <span class="layui-breadcrumb">

      </span>
      <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" href="javascript:location.replace(location.href);" title="刷新">
        <i class="layui-icon" style="line-height:30px">ဂ&#xe615;</i></a>
    </div>
    <div class="x-body">
      <div class="layui-row">
        <form class="layui-form layui-col-md12 x-so">
        
	      <input class="layui-input" placeholder="开始日" value="{:I('start')}" name="start" id="start">
	      <input class="layui-input" placeholder="截止日"  value="{:I('end')}" name="end" id="end">
          <input type="text" name="uid"  value="{:I('uid')}" placeholder="请输入团长uid" autocomplete="off" class="layui-input">
          <div class="layui-input-inline">
            <select name="status">
              <option value="0" <php>if(I("status")==0) echo 'selected' </php>>状态选择</option>
              <option value="1" <php>if(I('status') == 1) echo 'selected'</php>>待审核</option>
              <option value="2" <php>if(I('status') == 2) echo 'selected'</php>>已打款</option>
              <option value="3" <php>if(I('status') == 3) echo 'selected'</php>>已拒绝</option>
              
            </select>
          </div>
          <button class="layui-btn" id="search"  lay-submit="" lay-filter="sreach"><i class="layui-icon">&#xe615;</i></button>

        </form>
      </div>
      <xblock>
        <button class="layui-btn layui-bg-red" onclick="delAll('','{:U('del')}')"><i class="layui-icon"></i>永久删除</button>
        <button class="layui-btn layui-bg-green" onclick="issetAll('','{:U('isagree')}')">批量同意打款</button>
        <button class="layui-btn layui-bg-blue" onclick="issetAll('','{:U('isnotagree')}')">批量拒绝打款</button>
        <span class="x-right" style="line-height:40px">共有数据：{$count} 条</span>
      </xblock>
      <table class="layui-table">
        <thead>
          <tr>
		    <th>
		    
		        <div class="layui-unselect header layui-form-checkbox" lay-skin="primary"><i class="layui-icon">&#xe605;</i></div>
		        
		    </th>
            <th>ID</th>
            <th>团长信息</th>
            <th>提现金额</th>
            <th>实际扣除金额</th>
            <th>手续费</th>
            <th>申请提现时间</th>
            <th>提现打款时间</th>
            <th>状态</th>
            <th>原因</th>
            <th>操作</th>
          </tr>
        </thead>
        <tbody>
        <volist name="list" id="vo">
          <tr>
            <td>
            <if condition='$vo["status"] eq 1'>
          		<div class="layui-unselect layui-form-checkbox" lay-skin="primary" data-id='{$vo['id']}'><i class="layui-icon">&#xe605;</i></div>
          	</if>	
			</td>
            <td>{$vo['id']}</td>
            <td><img src="{$vo['head']}">{$vo['name']}</td>
            <td>{$vo['jiner']}</td>
            <td>{$vo['kou_jiner']}</td>
            <td>{$vo['fee']}</td>
            <td>{$vo['addtime']|date='Y-m-d H:i:s',###}</td>
            <td>
            {$vo['updatetime']|date='Y-m-d H:i:s',###}
            </td>
            <td>
              <switch name="vo['status']">
                 <case value="1">待审核</case>
                 <case value="2"><font color='green'>已打款</font></case>
                 <case value="3"><font color='red'>已拒绝</font></case>
              </switch>
            </td>
            <td>
            {$vo['reason']}
            </td>
            <td>
			<if condition='$vo["status"] eq 1'>
              <a title="同意打款"  class="layui-btn layui-btn-warm layui-btn-xs" onclick="setStatus(this,'{$vo['id']}','{:U('singleAgreePay')}')" href="javascript:;">
                同意打款
              </a>
              <a title="拒绝打款"  class="layui-btn layui-btn-danger layui-btn-xs" onclick="setStatus(this,'{$vo['id']}','{:U('singleNotAgreePay')}')" href="javascript:;">
 	   拒绝打款
              </a>              
			<else/>
			-
			</if>
            
            </td>          
          </tr>
        </volist>


        </tbody>
      </table>
      <div class="page" id="page">
        {$page}
      </div>

    </div>
<script>
    layui.use('laydate', function(){
        var laydate = layui.laydate;

        //执行一个laydate实例
        laydate.render({
            elem: '#start' //指定元素
        });

        //执行一个laydate实例
        laydate.render({
            elem: '#end' //指定元素
        });
    });
    
    function issetAll(argument,url){
	    var data = tableCheck.getData();
	    
	    layer.confirm('确认要这样操作吗？',function(index){

	        if(data == false || data=='undefined'){
	            layer.msg('参数错误',{icon:5});
	            return false;
	        }
	        $.post(url,{id:data},function (res) {
	            if(res.code){
	                layer.msg(res.msg,{icon:5});
	            }else{

	                layer.msg('操作成功', {icon: 1});
	                location.replace(location.href);
	            }

	        })

	    });
    }

    </script>

<include file="Public/footer"/>

